package Controller.Singerlike;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import Bean.joinHadoopBean;
import Dao.SingerLikeDao;

public class ThirtyYearsChartContoller implements Controller{
	private SingerLikeDao dao;
	public void setDao(SingerLikeDao dao) {
		this.dao = dao;
	}
	@Override
	public ModelAndView handleRequest(HttpServletRequest req,
			HttpServletResponse arg1) throws Exception {
		System.out.println("30대 가수별 선호 연령대 클래스");
		
		List<joinHadoopBean> thirtysinger = dao.thirtysingerlike(); 
		for (joinHadoopBean joinHadoopBean : thirtysinger) {
			System.out.println("=================================");
			System.out.println(joinHadoopBean.getSingerbean().getS_singer());
			System.out.println(joinHadoopBean.getSingeralbean().getSgl_count());
		}
		
		ModelAndView mav = new ModelAndView();
		mav.setViewName("thirtysingerlike");
		mav.addObject("thirtysinger",thirtysinger);
		return mav;
	}

}
